import { NextRequest, NextResponse } from 'next/server'
import { createServerClient } from '@supabase/ssr'
import { getUsersWithStats } from '@/lib/database'

export async function GET(request: NextRequest) {
  try {
    // 暂时跳过认证检查，直接返回数据
    const users = await getUsersWithStats()

    return NextResponse.json({
      success: true,
      data: users
    })

  } catch (error) {
    console.error('获取用户列表失败:', error)
    return NextResponse.json(
      { error: '服务器内部错误' },
      { status: 500 }
    )
  }
}
